/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 *
 * @author Nhan
 */
public class DBConnector {
   Connection con = null;
   public DBConnector() {
        String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        String url = "jdbc:sqlserver://localhost:1433; databaseName = Assignment1; user = sa; password = 12345";

        try {
            Class.forName(driver);
            con = DriverManager.getConnection(url);
        } catch (Exception e) {
            System.out.println(e);
        }
    }
    public Connection getCon() {
        return this.con;
    }
}
